#define  _CRT_SECURE_NO_WARNINGS 1

#include "CirQueue.h"

void TestCirQueue()
{
	CirQueue CQ;
	CirQueueInit(&CQ);

	CirQueuePush(&CQ, 1);
	CirQueuePush(&CQ, 2);
	CirQueuePush(&CQ, 3);
	CirQueuePush(&CQ, 4);
	CirQueuePush(&CQ, 5);

	printf("CirQueueFront: %d\n", CirQueueFront(&CQ));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQ));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQ));

	CirQueuePop(&CQ);
	CirQueuePop(&CQ);

	printf("CirQueueFront: %d\n", CirQueueFront(&CQ));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQ));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQ));

	CirQueuePush(&CQ, 5);
	CirQueuePush(&CQ, 5);
	CirQueuePush(&CQ, 5);
	CirQueuePush(&CQ, 5);

	CirQueuePop(&CQ);

	printf("CirQueueFront: %d\n", CirQueueFront(&CQ));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQ));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQ));

	CirQueuePop(&CQ);
	CirQueuePop(&CQ);
	CirQueuePop(&CQ);
	

	printf("CirQueueFront: %d\n", CirQueueFront(&CQ));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQ));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQ));

	while (!CirQueueEmpty(&CQ))
	{
		printf("%d ", CirQueueFront(&CQ));
		CirQueuePop(&CQ);
	}
	printf("\n");
}

int main()
{
	TestCirQueue();

	return 0;
}
